All storage media has defects that must be accounted for in the storage system design. In most cases, there are both manufacturing defects and grown defects. Manufacturing defects are due to imperfections and errors in the manufacturing process. Grown defects are discovered during use and are normally caused by wear, debris, impact, long term migration, aging or other processes.
Each type of storage technology has its own properties, defect causes, and characteristics. For media types that employ an integrated control function (such as Hard Disk Drives (HDDs), Solid State Drives (SSDs), USB (Universal Serial Bus) Flash, . . . ), the medium is typically tested during the manufacturing process and areas with defects that are significant enough to cause degradation or data loss are marked as bad using a method compatible with the media type and storage control system. Most storage systems also have methods of detecting grown defects during operation either before or after medium usage.
Not all defects can be avoided, so most storage systems implement some type of error correction algorithm in order to recover data that has errors. By avoiding areas of the medium that contains defects, the ECC effectiveness is increased.